/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cassys.ejb.clients;

import cassys.application.services.StudentManagementBeanRemote;
import cassys.domain.classManagement.Student;
import java.util.List;

/**
 *
 * @author User
 */
public class StudentManagementDelegate {

    private StudentManagementBeanRemote studentManagementBean = null;

    public StudentManagementDelegate() {
        try {
            studentManagementBean = ServiceLocator.getInstance().lookupStudentManagementBean();
        } catch (Exception e) {
            System.out.println(e.getStackTrace());

        }

    }

    public List<Student> getAllStudents() {
        return studentManagementBean.getAllStudents();
    }

    public void crateStudent(Student student) {
        System.out.println(student.toString());
        studentManagementBean.createStudent(student);
    }

    public Student findByStudentId(long studentId) {
        return studentManagementBean.findByStudentId(studentId);
    }
    
        public void updateStudent(Student student){studentManagementBean.updateStudent(student);}
    
    public void deleteStudent(Student student){studentManagementBean.deleteStudent(student);}
}
